'''
@Project ：my_python_project 
@File    ：继承1.py
@IDE     ：PyCharm 
@Author  ：xionglinhui
@Date    ：2024/10/22 上午7:57 
'''
class ParentClass1: #定义父类
    x=123
    pass

class ParentClass2: #定义父类
    pass

class SubClass1(ParentClass1): #单继承
    pass

class SubClass2(ParentClass1,ParentClass2): #多继承
    pass


# 通过类的内置属性__bases__可以查看类继承的所有父类
print(SubClass1.__bases__)   # (<class '__main__.ParentClass1'>,)
print(SubClass2.__bases__)   # (<class '__main__.ParentClass1'>, <class '__main__.ParentClass2'>)
print(SubClass1.x)           # 123

print(ParentClass1.__bases__)  # (<class 'object'>,)
print(ParentClass2.__bases__)  # (<class 'object'>,)